#include "ObjectAllPubSubTypes.h"
#include "default_participant.h"
#include "default_subscriber.h"
//#include "geometry_msgs/msgs/Position.h"
// #include "position_sub_callback.h"

int main() {

  // Create participant. Arguments-> Domain id, QOS name
  DefaultParticipant dp(0, "hi");

  // Message
  // idl_msg::Position pos_msg{};
  vis_msg::ObjectAll obj{};

  // Create subscriber with msg type
  DDSSubscriber obj_sub(vis_msg::ObjectAllPubSubType(), &obj, "obj",dp.participant());

  obj_sub.init();

  for (;;) {

    // Blocks until new data is available
    obj_sub.listener->wait_for_data();

    std::cout <<"id:" << (obj.alarmInfo()).m_ATP_COMMUNICATION_TIMEOUT_ALARM_INFO() << "---"<<obj.id()<<" --- "<<std::endl;
  }
}
